package com.atguigu.headline.service.impl;

import com.atguigu.headline.dao.NewsUserDao;
import com.atguigu.headline.dao.impl.NewsUserDaoImpl;
import com.atguigu.headline.pojo.NewsUser;
import com.atguigu.headline.service.NewsUserService;
import com.atguigu.headline.util.MD5Util;

public class NewsUserServiceImpl implements NewsUserService {
    NewsUserDao newsUserDao=new NewsUserDaoImpl();
    @Override
    public NewsUser findUser(String username) {
        return newsUserDao.finduser(username);
    }

    @Override
    public NewsUser getUserInfo(int i) {
        return newsUserDao.getUserInfo(i);
    }

    @Override
    public Integer registUser(NewsUser newsUser) {
        newsUser.setUserPwd(MD5Util.encrypt(newsUser.getUserPwd()));
        return newsUserDao.registerUser(newsUser);
    }
}